from django.db import models


# Create your models here.

class Classroom(models.Model):
    c_name = models.CharField(max_length=16, verbose_name='名称')
    b_Number = models.CharField(max_length=16, verbose_name='人数')
    d_theory = models.BooleanField(verbose_name='是否为理论教室')
    e_img = models.FileField(verbose_name='图片', upload_to='img1', default='')

    def __str__(self):
        return '%s' % self.c_name

    class Meta():
        verbose_name_plural = '教室信息'


class Equipment(models.Model):
    f_name = models.CharField(max_length=16, verbose_name='名称')
    Classroom = models.ForeignKey('Classroom', on_delete=models.CASCADE)
    normal = models.BooleanField(verbose_name='是否正常教室')
    code = models.CharField(max_length=16, verbose_name='IMEI码')
    k_img = models.FileField(verbose_name='图片', upload_to='img1', default='')

    def __str__(self):
        return '%s' % self.f_name

    class Meta():
        verbose_name_plural = '设备信息'


class Health(models.Model):
    m_mane = models.CharField(max_length=16, verbose_name='名称')
    Classroom = models.ForeignKey('Classroom', on_delete=models.CASCADE)
    Rubbish = models.CharField(max_length=16, verbose_name='卫生情况')
    Loser = models.CharField(max_length=16, verbose_name='负者人')

    def __str__(self):
        return '%s' % self.m_mane

    class Meta():
        verbose_name_plural = '卫生情况'


